<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <title>一个论坛</title>
    <link rel="stylesheet" href="{{ static_url('css/bootstrap.min.css') }}" type="text/css">
    <link rel="stylesheet" href="{{ static_url('css/style.css') }}" type="text/css">
    {% block head %}{% end %}
  </head>
  <body>
    <div id="body" class="container main-body">
      <div class="header clearfix">
        <nav>
          <ul class="nav nav-pills pull-right">
            <li role="presentation" class="active"><a href="/">主页</a></li>
            {% if current_user %}
              <li role="presentation"><a href="/entry/edit">发帖</a></li>
              <li role="presentation" class="dropdown">
                <a class="data-toggle" data-toggle="dropdown">管理</a>
                <ul class="dropdown-menu">
                  <li><a href={{ '/auth/%s' % current_user['_id'] }}>我的帖子</a></li>
                  <li><a href="/auth/update_pass">更改密码</a></li>
                  <li><a href={{ '/auth/logout?next=' + url_escape(request.uri) }}>退出</a></li>
                </ul>
              </li>
            {% else %}
              <li role="presentation"><a href={{ '/auth/create?next=' + url_escape(request.uri) }}>注册</a></li>
              <li role="presentation"><a href={{ '/auth/login?next=' + url_escape(request.uri) }}>登录</a></li>
            {% end %}
          </ul>
        </nav>
        <h3 class="text-muted">一个论坛</h3>
      </div>
      <div name="content">
        {% block body %}{% end %}
      </div>
    </div>

    <script src="{{ static_url('js/jquery.min.js') }}"></script>
    <script src="{{ static_url('js/bootstrap.min.js') }}"></script>
    <script src="{{ static_url('js/utils.js') }}"></script>
    {% block bottom %}{% end %}
  </body>
</html>
